﻿using Model.ServiceConnect;
using System;

namespace JTE_WCF_Client
{
    class Program
    {

        //cmd JTE_WCF_Client.exe admin 1 
        static void Main(string[] args)
        {
           // args = new string[] { "admin", "1", "8", "1" };
            if (args == null || args.Length != 4)
            {
                Logger.Info(string.Format("刷新房态参数错误"));
                return;
            }
#if DEBUG
            Logger.Info(string.Format("刷新房态入参:{0} {1} {2} {3}", args));
#endif
            JTE_Client shellNewEx = new JTE_Client();
            shellNewEx.Login(args[0], args[1]);
            long id = Convert.ToInt64(args[2]);
            short lock_flag = Convert.ToInt16(args[3]);
            try
            {
                RoomConnect.UpdateRRoom(new Model.RoomService.TRRoom()
                {
                    _id = id,
                    _lock_room = new short?((short)lock_flag)
                });
            }
            catch (Exception ex)
            {
                Logger.Info(string.Format("刷新房态错误:{0}", ex));
            }

            shellNewEx.Close();
        }



    }
}
